1. Field of the Invention
The present invention relates to the storage of data in a microprocessor smartcard.
2. Description of the Background Art
Smartcard are generally cards with the format of a credit card or tokens fitted with an electronic microcircuit, based on memories and a microcontroller, these being devised so as to allow the running of a for example bank or health transaction. They communicate with their environment by means of readers with which they exchange messages and comply with ISO Standard 7816-4. To make a transaction run, they need to preserve and update a certain number of items of information in a reprogrammable built-in memory termed an EEPROM (Electrically Erasable Programmable Read Only Memory).
Hitherto, the storage of data in the EEPROM of a smartcard has been organized by ISO Standard 7816-4 into three levels of files:
a first level termed the main file consisting of the accessible part of the space of the EEPROM memory, provided with a defining header and with headers for tagging the second-level files which it contains;
a second level of directory files (or dedicated file) each provided with a defining header and with headers for tagging the third-level files which it contains, and
a third level of so-called elementary files which are of two types: either of transparent type, the data of the records not being structured within the file, write and read addressing being delegated to the application program controlling the transaction running in the smartcard, or of record type, the data being stored in fixed-size blocks managed by the operating system of the microcontroller of the smartcard.
With a system for storing data in a smartcard EEPROM memory, as governed by ISO Standard 7816-4, the application program controlling the transaction running in the smartcard must know the sizes of the data blocks which it proposes to store in the EEPROM memory of the smartcard since the two types of elementary files permitted, in which the data are actually stored, are of fixed length. This limitation precludes the compression of data within the smartcard since, in this case, the application program controlling the transaction running in the smartcard no longer has control over the length of the data blocks after compression which will actually be stored.
The purpose of the present invention is to avoid this limitation by creating a new type of third-level file termed a variable-length elementary file (or Record Variable File) managed by proprietary instructions of ISO Standard 7816-4, doing so in order to maintain upward compatibility with this standard.
Its subject is a process for storing data in a rewritable smartcard memory, characterized in that it consists in storing the data at least in part in elementary files of variable lengths each made up of a variable-length chain of domains of fixed lengths and of low individual capacities of the rewritable memory, the said chain having its domains tagged by means of a domain allocation table which changes as a function of the number of data items actually stored.
Advantageously, the said elementary record files of variable lengths form part of larger directory files, of variable type, containing their tables for allocating domains which each consist of a header placed in a management area of the host directory file and locating the start of chain, and of links placed at the start or at the end of each domain identifying the relevant domain""s membership of a chain, that is to say its occupancy, and locating the next domain in the chain.
Advantageously, the said elementary files of variable lengths coexist together with the elementary files of fixed lengths within distinct directory files and are managed by an operating system responding to commands consisting of several successive fields: an instruction class field, an instruction field and a parameter field, the instruction class making it possible to distinguish a directory file of variable type containing files of variable lengths from directory files of fixed type containing files of fixed lengths so that each elementary file is managed according to its kind, by the operating system either alone, or under the dependence of an application program intervening at a higher level.